package com.wogu.util;

public class ArrayUtil {
	
	public static String join(String[] arr, String separator) {
		StringBuilder sb = new StringBuilder();
		int key = arr.length - 1;
		for(int i = 0; i <= key; i++) {
			sb.append(arr[i]);
			if(i < key)
				sb.append(separator);
		}
		
		return sb.toString();
	}
	
	public static String join(String[] arr) {
		return join(arr, "");
	}
	
	public static String[] repeat(String repeatStr, int num) {
		String[] arr = new String[num];
		for(int i = 0; i < num; i++)
			arr[i] = repeatStr;
		
		return arr;
	}
}
